<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex system_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-stretch justify-between system_fd0_0'>
          <view class='flex flex-wrap align-center system_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  system_fd0_0_c0_c0'>&#xe794;</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <text class='system_fd0_0_c1_c0'>{{$t('设置')}}</text>
          </view>
          <view class='flex align-center justify-end system_fd0_0_c2'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!--选择语言开始 -->
      <benben-picker ref="benbenWritePickerCodepicker1" :visible.sync="pickerDiy1699406739792"
        :label.sync='language_label' :value.sync='language_id' :options='languageType' mode='selector' :mask-show='true'
        :timeout='true' :picker-height='88' default-type='value' :default-props='{"label":"name","value":"value"}'>
        <template #picker-header>
          <view class='flex flex-wrap align-center justify-between system_picker1_0'>
            <text class='system_picker1_0_c0' @tap="$refs.benbenWritePickerCodepicker1.cancel()">{{$t('取消')}}</text>
            <text></text>
            <text class='system_picker1_0_c2'
              @tap="switchLaugn">{{$t('确认')}}</text>
          </view>
        </template>
      </benben-picker>
      <!--选择语言结束 -->
      <!---基本设置flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch system_flex_2">
        <view class='flex flex-direction flex-wrap align-stretch system_fd2_0'>
          <view class='flex flex-wrap align-center justify-between system_fd2_0_c0'
            @tap.stop="pickerDiy1699406739792=true">
            <text class='system_fd2_0_c0_c0'>{{$t('语言')}}</text>
            <view class='flex flex-wrap align-center'>
              <text class='system_fd2_0_c0_c1_c0'>{{language_label}}</text>
              <text class='fu-iconfont2  system_fd2_0_c0_c1_c1'>&#xE7F2;</text>
            </view>
          </view>
        </view>
        <view class='flex flex-wrap align-center system_fd2_1'>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch system_fd2_0'>
          <view class='flex flex-wrap align-center justify-between system_fd2_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/xtsz/changePwd/changePwd`">
            <text class='system_fd2_0_c0_c0'>{{$t('修改密码')}}</text>
            <text class='fu-iconfont2  system_fd2_2_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd2_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/xtsz/changeBingaccount/changeBingaccount`">
            <text class='system_fd2_0_c0_c0'>{{$t('修改账号')}}</text>
            <text class='fu-iconfont2  system_fd2_2_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd2_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/xtsz/aboutUs/aboutUs`">
            <text class='system_fd2_0_c0_c0'>{{$t('关于我们')}}</text>
            <text class='fu-iconfont2  system_fd2_2_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd2_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/dlzc/agreements/agreements`">
            <text class='system_fd2_0_c0_c0'>{{$t('用户注册协议')}}</text>
            <text class='fu-iconfont2  system_fd2_2_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd2_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/dlzc/privacyPolicy/privacyPolicy`">
            <text class='system_fd2_0_c0_c0'>{{$t('隐私政策')}}</text>
            <text class='fu-iconfont2  system_fd2_2_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd2_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/dlzc/zhuxiaozhanghao/zhuxiaozhanghao`">
            <text class='system_fd2_0_c0_c0'>{{$t('注销账号')}}</text>
            <text class='fu-iconfont2  system_fd2_2_c0_c1'>&#xE7F2;</text>
          </view>
        </view>
        <view class='flex flex-wrap align-center system_fd2_1'>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch system_fd2_0'>
          <view class='flex flex-wrap align-center system_fd2_0_c0' @tap.stop="clearCacheFunc()">
            <text class='system_fd2_0_c0_c0'>{{$t('清除缓存')}}</text>
            <text class='system_fd2_4_c0_c1'>{{appRubbishCacheSize}}</text>
            <text class='fu-iconfont2  system_fd2_2_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center system_fd2_4_c1' @tap.stop="appRenewFunc()">
            <text class='system_fd2_0_c0_c0'>{{$t('检查更新')}}</text>
            <text class='system_fd2_4_c0_c1'>{{appVersion}}</text>
            <text class='fu-iconfont2  system_fd2_2_c0_c1'>&#xE7F2;</text>
          </view>
        </view>
      </view>

      <!---基本设置flex布局结束-->
      <benben-popup v-model="popupShow1656992350800" :mask="true" :mask-close-able="true" mode='center'>
        <!---退出登录flex布局开始-->
        <view class="flex flex-direction flex-wrap align-center system_flex_3" >
          <text class='system_fd3_0'>{{$t('提示')}}</text>
          <text class='system_fd3_1'>{{$t('确定退出当前账号？')}}</text>
          <view class='flex align-center system_fd3_2'>
            <button class='system_fd3_2_c0' @tap.stop="popupShow1656992350800=false"
              open-type="contact">{{$t('取消')}}</button>
            <button class='system_fd3_2_c1' @tap.stop="logOutFunc()" open-type="contact">{{$t('确定')}}</button>
          </view>
        </view>

        <!---退出登录flex布局结束-->

      </benben-popup>
      <view class="flex flex-wrap align-stretch justify-center benben-position-layout flex system_flex_4"
        @tap.stop="popupShow1656992350800=true">
        <button class='system_fd4_0'>{{$t('退出登录')}}</button>

      </view>
      <view :style="{height: '140rpx'}"></view>
      <benben-popup v-model="popupShow1679541357000" :mask="true" :mask-close-able="true" mode='center'>
        <!---清除缓存flex布局开始-->
        <view class="flex flex-direction flex-wrap align-center system_flex_5">
          <text class='system_fd5_0'>{{$t('提示')}}</text>
          <text class='system_fd5_1'>{{$t('确定要清除本地缓存？')}}</text>
          <view class='flex align-center system_fd5_2'>
            <button class='system_fd5_2_c0' @tap.stop="popupShow1679541357000=false">{{$t('取消')}}</button>
            <button class='system_fd5_2_c1' @tap.stop="clearCacheFunc()">{{$t('确定')}}</button>
          </view>
        </view>

        <!---清除缓存flex布局结束-->

      </benben-popup>
      <app-update ref="update"></app-update>


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "popupShow1679541357000": false,
        "popupShow1656992350800": false,
        "pickerDiy1699406739792": false,
        "dataMessage": {
          "aid": "",
          "user_nickname": "",
          "user_avatar": "",
          "user_mobile": "",
          "cancel_type": "",
          "create_time": "",
          "status": "",
          "cancel_reason": "",
          "cancel_type_text": ""
        },
        "languageType": [{
          "name": global.i18n.t("简体中文"),
          "value": "zh-Hans",
          "image": "",
          "laugu":'zh-Hans'
        }, {
          "name": global.i18n.t("繁体中文"),
          "value": "zh-Hant",
          "image": "",
          "laugu":'zh-Hant'
        }],
        "language_id": "",
        "language_label": global.i18n.t("简体中文")
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      appVersion() {
        // 获取版本号
        return this.$store.state.appVersion
      },
      appRubbishCacheSize() { // 获取缓存大小
        return this.$store.state.appRubbishCacheSize
      }
    },
    watch: {},
    onLoad(options) {
      this.language_id=global.locale
      this.language_label=this.languageType.filter(item=>item.value==this.language_id)[0].name
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.$store.dispatch('getAppVersion') // 更新版本号
      this.$store.dispatch('getAppCache') // 更新缓存大小
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      // 切换语言
      switchLaugn(){
        this.$refs.benbenWritePickerCodepicker1.pickerConfirm()
        uni.$emit("languages");
        let obj={
          name: this.language_label,
          value: this.language_id
        }

        this.$store.commit('setLocale', {
          "locale": obj
        })
        // console.log('global.locale',global.locale)
      },

      //获取注销状态1提交 3驳回
      async gozhuxiaoFunc() {
        let datadataDetails = await this.$api.get(global.apiUrls.post637c4deb97aa9, {
          sort_type: 'desc'
        });
        let status = datadataDetails.data.data.status
        if (datadataDetails.data.code != 1) { //如果code=0 没申请过
          uni.navigateTo({
            url: `/pages/xtsz/CancelAccount/CancelAccount`
          })
        } else {
          uni.navigateTo({
            url: `/pages/xtsz/logOutSubmit/logOutSubmit`
          })
        }
      },
      //清除缓存
      clearCacheFunc() {

        this.popupShow1679541357000=false
        this.$store.dispatch('appClearCache')
        console.log('222222')
      },
      //app更新
      appRenewFunc() {
        this.$util.debounce(
          () => {
            this.$refs.update.checkAppUpdate()
          },
          1000,
          true
        )
        // this.$message.info('已是最新版本');
      },
      //退出登录
      logOutFunc() {
        this.$store.commit('logout')
        this.$urouter.reLaunch(`/pages/tabBar/loginPage/loginPage`);
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(248, 248, 248, 1);
    background-size: 100% auto;
  }

  .system_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .system_fd0_0_c2 {
    padding: 0rpx 0rpx 0rpx 0rpx;
    width: 100rpx;
  }

  .system_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: var(--benbenFontColor0);
  }

  .system_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 400;
    color: #333;
  }

  .system_fd0_0_c0 {
    width: 100rpx;
  }

  .system_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .system_picker1_0_c2 {
    color: rgba(1, 129, 255, 1);
  }

  .system_picker1_0_c0 {
    color: rgba(191, 191, 191, 1);
  }

  .system_picker1_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }

  .system_flex_2 {
    font-size: 32rpx;
    padding: 0rpx 0rpx 64rpx 0rpx;
  }

  .system_fd2_4_c1 {
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .system_fd2_4_c0_c1 {
    font-size: 28rpx;
    color: rgba(191, 191, 191, 1);
    margin: 0rpx 24rpx 0rpx auto;
  }

  .system_fd2_2_c0_c1 {
    font-size: 26rpx;
    color: rgba(191, 191, 191, 1);
  }

  .system_fd2_1 {
    background: rgba(248, 248, 248, 1);
    height: 20rpx;
    background-size: 100% auto !important;
  }

  .system_fd2_0_c0_c1_c1 {
    font-size: 26rpx;
    color: rgba(191, 191, 191, 1);
    margin: 0rpx 0rpx 0rpx 32rpx;
  }

  .system_fd2_0_c0_c1_c0 {
    font-size: 32rpx;
    color: rgba(102, 102, 102, 1);
  }

  .system_fd2_0_c0_c0 {
    font-size: 32rpx;
    color: var(--benbenFontColor0);
  }

  .system_fd2_0_c0 {
    border-bottom: 1px solid #eee;
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .system_fd2_0 {
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    background-size: 100% auto !important;
  }

  .system_flex_3 {
    background: #fff;
    width: 540rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    padding: 0rpx 0rpx 41rpx 0rpx;
  }

  .system_fd3_2_c1 {
    background: rgba(1, 129, 255, 1);
    border-radius: 36rpx;
    font-size: 28rpx;
    color: rgba(255, 255, 255, 1);
    width: 176rpx;
    height: 72rpx;
  }

  .system_fd3_2_c0 {
    background: rgba(248, 248, 248, 1);
    border-radius: 36rpx;
    font-size: 28rpx;
    color: rgba(51, 51, 51, 1);
    width: 176rpx;
    height: 72rpx;
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .system_fd3_2 {
    margin: 37rpx 0rpx 0rpx 0rpx;
  }

  .system_fd3_1 {
    line-height: 44rpx;
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
  }

  .system_fd3_0 {
    font-size: 36rpx;
    font-weight: 800;
    line-height: 44rpx;
    color: #333333;
    margin: 40rpx 0rpx 40rpx 0rpx;
  }

  .system_flex_4 {
    background: rgba(248, 248, 248, 1);
    width: 750rpx;
    height: 140rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    background-size: 100% auto !important;
  }

  .system_fd4_0 {
    background: rgba(1, 129, 255, 1);
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    font-size: 32rpx;
    color: rgba(255, 255, 255, 1);
    width: 686rpx;
    height: 88rpx;
    line-height: 88rpx;
    margin: 0rpx 32rpx 0rpx 32rpx;
  }

  .system_flex_5 {
    background: #fff;
    width: 540rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    padding: 0rpx 0rpx 41rpx 0rpx;
  }

  .system_fd5_2_c1 {
    background: rgba(1, 129, 255, 1);
    border-radius: 36rpx;
    font-size: 28rpx;
    color: rgba(255, 255, 255, 1);
    width: 176rpx;
    height: 72rpx;
    margin: 0rpx 0rpx 0rpx 20rpx;
  }

  .system_fd5_2_c0 {
    background: rgba(248, 248, 248, 1);
    border-radius: 36rpx;
    font-size: 32rpx;
    color: rgba(51, 51, 51, 1);
    width: 176rpx;
    height: 72rpx;
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .system_fd5_2 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .system_fd5_1 {
    line-height: 42rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #666666;
  }

  .system_fd5_0 {
    font-size: 36rpx;
    font-weight: 800;
    line-height: 44rpx;
    color: #333333;
    margin: 48rpx 0rpx 32rpx 0rpx;
  }
</style>
